package com.arcticcoding.telemetrie;


/**
 * Superclass for all TelemetrieServices
 * @author steffenschuhmann
 *
 */
public abstract class TelemetrieService extends Thread implements Runnable{
	private boolean shutdown;
	
	
	public TelemetrieService() {
		shutdown = false;
	}
	
	/**
	 * Creates this service
	 */
	public void create() {
		this.start();
	}
	
	/**
	 * Stop the running Service.
	 * 
	 * Implement all needed unregistrations and close all Streams.
	 */
	protected void shutdown() {
		shutdown = true;
	}
	
	public void run() {
		while(!shutdown) {}
	}	
	
	//TODO Maybe implement an abstract Params class which must be implemented for every Service
}
